using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class ColliderDetector : MonoBehaviour
{
    private Monster monster;

    private void OnEnable()
    {
        monster = transform.parent.GetComponent<Monster>();
    }

    private void OnTriggerEnter2D(Collider2D other)
    {
        // print(other.name + "[" + other.gameObject.layer + "]--FlowerBlueS");
        if (other.gameObject.layer.Equals(9))
        {
            monster.monsterState = MonsterState.Attack;
        }
    }

    private void OnTriggerExit2D(Collider2D other)
    {
        if (other.gameObject.layer.Equals(9))
        {
            monster.monsterState = MonsterState.Idle;
        }
    }
}
